import requests

from common.get_empId_util import get_empId_util
from common.get_token_util import get_token_util
from config import IP


class IhrmEmpApi:
    @classmethod
    def ihrm_emp_insert_api(cls, jsondata):
        resp = requests.post(url=f"{IP}/api/sys/user",
                             headers={"Authorization": get_token_util()},
                             json=jsondata)
        return resp


    @classmethod
    def ihrm_emp_select_api(cls,id):
        resp = requests.get(url=f"{IP}/api/sys/user/{id}",
                             headers={"Authorization": get_token_util()})
        return resp

    @classmethod
    def ihrm_emp_delete_api(cls):
        resp = requests.delete(url=f"{IP}/api/sys/user/{get_empId_util()}",
                             headers={"Authorization": get_token_util()})
        return resp



if __name__ == '__main__':

    print(IhrmEmpApi.ihrm_emp_delete_api())
